package io.renren.api.test;

import io.renren.common.validator.ValidatorUtils;

import javax.validation.constraints.NotBlank;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Command {
    public static void exeCmd(String commandStr) {
        BufferedReader br = null;
        try {
            Process p = Runtime.getRuntime().exec(commandStr);
            br = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line = null;
            StringBuilder sb = new StringBuilder();
            while ((line = br.readLine()) != null) {
                sb.append(line + "\n");
            }
            System.out.println(sb.toString());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void main(String[] args) {
        /*System.out.println("****");
        String commandStr = "ls -al";
        //String commandStr = "ipconfig";
        Command.exeCmd(commandStr);
        System.out.println("111");*/

        A a=new A();
        a.name = "dd";
        ValidatorUtils.validateEntity(a);

       

    }



}


class A extends B {

    @NotBlank(message = "A不能为空")
     String name;

     String score;

}

class B {
    @NotBlank(message = "B不能为空")
     String name;

     String score;

}
